home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-21 | 1.1 KB | 53 lines | [TEXT/RLAB] |
- format:
-
- Syntax: format ( )
- format ( precision )
- format ( width , precision )
-
- Description:
-
- Format sets the output print format for all numeric output. If
- no arguments are supplied, then the output print formats are
- reset to the default values.
-
- If format is called with one argument, then the arguments
- value specifies the format precision. If two arguments are
- supplied, then the 1st specifies the format field width, and
- the second specifies the format precision.
-
- Example:
-
- > 123456789.123456789
- 1.235e+08
-
- > format(10);
-
- > 123456789.123456789
- 123456789.1
-
- > format();
-
- > a = rand(3,3)
- a =
- matrix columns 1 thru 3
- 1 0.3331 0.6646
- 0.9745 0.03694 0.08467
- 0.6475 0.1617 0.2041
-
- > format(10);
- > a
- a =
- matrix columns 1 thru 3
- 0.9999996424 0.3330855668 0.6646450162
- 0.9745196104 0.03694454208 0.08467286825
- 0.6474838853 0.1617118716 0.2041363865
-
- > format(15,10);
- > a
- a =
- matrix columns 1 thru 3
- 0.9999996424 0.3330855668 0.6646450162
- 0.9745196104 0.03694454208 0.08467286825
- 0.6474838853 0.1617118716 0.2041363865
-
-